package com.xbongbong.saas.enums.dictionary;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.constant.PaasConstant;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * 数据字典-发货状态
 *
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/2/26 10:19
 * @since v1.0
 */
@Getter
public enum ExpressStatusEnum {

    // 发货状态
    LACK("1", "enum.expressStatus.name.lack", "lack"),


    DELIVERED("2", "enum.expressStatus.name.delivered", "delivered"),


    SHIPPED("3", "enum.expressStatus.name.shipped", "Shipped"),
    ;

    private String code;
    private String name;
    private String attr;

    ExpressStatusEnum(String code, String name, String attr) {
        this.code = code;
        this.name = name;
        this.attr = attr;
    }

    /**
     * 获取全部枚举code
     */
    public static List<String> getAllCode() {
        List<String> list = new ArrayList<>(PaasConstant.DEFAULT_INITIAL_CAPACITY);
        for (ExpressStatusEnum cache : values()) {
            list.add(cache.getCode());
        }
        return list;
    }

    public String getName() {
        return I18nMessageUtil.getMessage(name);
    }
}
